home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Dimension 64 13
/
Dimension_64_Nr.13_19xx_-_de_Side_A.d64
/
reversi ii
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2023-02-26
|
11KB
|
357 lines
10000 rem ############################
10010 rem ############################
10020 rem ##### #####
10030 rem ##### r e v e r s i #####
10040 rem ##### #####
10100 rem ############################
10110 rem ############################
11010 poke53280,0:poke53281,0:print"[158][147]"
11020 print " [169] [223][146] [146] [146] [146] [146] [146] [146] [169] [223][146]"
11030 print " [146] [146] [161][146][161] [146] [146] [146] [146] [146] [146] [146]"
11040 print " [146] [146] [161][146][161] [146] [146] [146] [146] [146] [146]"
11050 print " [146] [146] [161][146][161] [146] [146] [146] [146] [146] [146] [146]"
11060 print " [223] [146][169] [161][146][161] [146] [146] [146] [146] [146] [223] [146][169]"
11070 print ""
11080 print ""
11090 print " kennen sie die spielregeln (j/n) ?"
11100 get a$
11110 if a$="j" then 11510
11120 if a$<>"n" then 11100
11200 print "[147] s p i e l r e g e l [146]"
11210 print " reversi ist ein altes chinesisches "
11220 print " brettspiel. ziel des spieles ist es"
11230 print " mehr steine auf dem brett zu haben"
11240 print " als der computer. dazu werden"
11250 print " abwechselnd eigene steine so auf das"
11260 print " brett gelegt, dass mit diesem stein"
11270 print " gegnerische steine an beiden seiten"
11280 print " eingeschlossen werden. diese steine"
11290 print " werden dann zu steinen eigener"
11300 print " farbe gemacht."
11301 print " space[146] druecken"
11302 get a$:if a$<>" " then 11302
11310 print "[147] s p i e l r e g e l [146]"
11320 print " sie sind an der reihe, wenn hinter"
11330 print " 'welches feld moechten sie besetzen'"
11340 print " diese flaeche [166][166] ist. dann geben sie"
11350 print " die ziffer am linken rand und dann"
11360 print " die ziffer am oberen rand des ge-"
11370 print " wuenschten feldes ein. diese zahlen"
11380 print " erscheinen dann an stelle von [166][166]."
11390 print " wenn sie keinen gueltigen zug machen"
11400 print " koennen geben sie eine '0' ein."
11510 print " moechten sie beginnen (j/n) ?"
11520 get m$:if m$<>"j" and m$<>"n" then 11520
12000 rem belegen der felder *************************************************
12010 poke 53,90
12020 poke 25816,0
12030 dim zc(40),ss(40),sc(40)
12040 for n=1 to 8:read m:next
12050 for n=25800 to 25807:read m:poke n,m:next
12060 for n=25600 to 25699:read m:poke n,m:poke n+256,m:next
12070 for n=25700 to 25799:read m:poke n,m+100:poke n+256,m:next
12080 for n=26112 to 26211:read m:poke n,m:next
12085 if fl=1 then 12100
12090 for n=24090 to 24457:read m:poke n,m:next
12100 restore
12200 h$=""
12210 c$=left$(h$,20)+"welches feld moechten sie besetzen? [166][166] [157][157][157]"
12220 d$=h$+"dieses feld gibt es nicht"
12230 e$=h$+"der zug ist illegal "
12240 f$=h$+"ich besetze feld [157][157][157]"
12250 g$=h$+"ich kann nicht setzen "
12260 as=2:ac=2:fl=0
13000 rem zeichnen des bildschirmes ******************************************
13010 print "[147] 1 2 3 4 5 6 7 8"
13020 print " [176][192][178][192][178][192][178][192][178][192][178][192][178][192][178][192][174] [209]:computer"
13030 print "1 [221][160][221][160][221][160][221][160][221][160][221][160][221][160][221][160][221]"
13040 print " [171][192][219][192][219][192][219][192][219][192][219][192][219][192][219][192][179] [146]:spieler"
13050 print "2 [221][160][221][160][221][160][221][160][221][160][221][160][221][160][221][160][221]"
13060 print " [171][192][219][192][219][192][219][192][219][192][219][192][219][192][219][192][179]"
13070 print "3 [221][160][221][160][221][160][221][160][221][160][221][160][221][160][221][160][221] anzahl der felder"
13080 print " [171][192][219][192][219][192][219][192][219][192][219][192][219][192][219][192][179] [163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163]"
13090 print "4 [221][160][221][160][221][160][221][209][221] [146][221] [221][160][221][160][221] computer: 2"
13100 print " [171][192][219][192][219][192][219][192][219][192][219][192][219][192][219][192][179]"
13110 print "5 [221][160][221][160][221][160][221][209][221] [146][221] [221][160][221][160][221] spieler : 2"
13120 print " [171][192][219][192][219][192][219][192][219][192][219][192][219][192][219][192][179]"
13130 print "6 [221][160][221][160][221][160][221][160][221][160][221][160][221][160][221][160][221]"
13140 print " [171][192][219][192][219][192][219][192][219][192][219][192][219][192][219][192][179]"
13150 print "7 [221][160][221][160][221][160][221][160][221][160][221][160][221][160][221][160][221]"
13160 print " [171][192][219][192][219][192][219][192][219][192][219][192][219][192][219][192][179]"
13170 print "8 [221][160][221][160][221][160][221][160][221][160][221][160][221][160][221][160][221]"
13180 print " [173][192][177][192][177][192][177][192][177][192][177][192][177][192][177][192][189]"
13190 if fl=1 then return
13200 print "";tab(22);"bedenkzeit"
13210 print tab(22);"[163][163][163][163][163][163][163][163][163][163]"
13220 print tab(22);"computer:"
13230 print "";tab(22);"spieler :"
14000 rem frage wer beginnt **************************************************
14010 if m$="n" then 40000
15000 rem eingabe des zuges **************************************************
15010 zs=ti
15020 poke 158,0:print c$;
15030 gosub 53000:get a$:if a$="" then 15030
15040 if a$="0" then ss(ss)=25600:ss=ss+1:goto 18000
15050 if val(a$)=0 or val(a$)=9 then print d$:goto 15020
15060 print left$(h$,20);tab(36);a$;
15070 gosub 53000:get b$:if b$="" then 15070
15080 if val(b$)=0 or val(b$)=9 then print d$:goto 15020
15090 print left$(h$,20);tab(37);b$
16000 rem zug auf legalitaet pruefen und ausfuehren **************************
16010 a=val(a$+b$)+25600
16020 if peek(a)<>0 then print e$:goto 15020
16030 d=0
16040 for n=1 to 8
16050 read j:k=a+j
16060 if peek(k)<>2 then 16150
16070 k=k+j
16080 if peek(k)=2 then 16070
16090 if peek(k)<>1 then 16150
16100 k=a+j
16110 h=(k-25600)/10
16120 poke(1025.5+int(h)*80+(h-int(h))*20),160
16130 poke k,1:k=k+j:d=d+1
16140 if peek(k)=2 then 16110
16150 next n:restore
16160 if d=0 then print e$:goto 15020
16170 poke a,1
16180 h=(a-25600)/10
16190 poke(1025.5+int(h)*80+(h-int(h))*20),160
16200 if fl=1 then return
16210 ss(ss)=a:ss=ss+1
17000 rem berechnung der felderzahl ******************************************
17010 as=as+d+1:ac=ac-d
17020 print left$(h$,9);tab(32);ac;"[157] "
17030 print "";tab(32);as;"[157] "
17040 if fl=1 then return
18000 rem zeitrechnung spieler ***********************************************
18010 gosub 53000
18020 ts=ts+(ti-zs)/60
18030 if a$="0" then 40000
19000 rem zugfeld veraendern *************************************************
19010 a=a+512
19020 for n=1 to 8
19030 read j
19040 poke (a+j),(peek(a+j)+1)
19050 next n:restore
19060 poke a,0
19999 if as+ac=64 then 50000
20000 rem wertung der felder *************************************************
20010 n=25611
20020 if peek(n)<>2 then 20210
20030 n=n+10
20040 if peek(n)=0 then poke n+100,170:goto 20110
20050 if peek(n)=2 then 20030
20060 n=n+10
20070 if peek(n)=1 then 20060
20080 poke n+100,172
20110 n=25611
20130 n=n+1
20140 if peek(n)=0 then poke n+100,170:goto 20190
20150 if peek(n)=2 then 20130
20160 n=n+1
20170 if peek(n)=1 then 20160
20180 poke n+100,172
20190 n=25711:poke n+11,160:poke n+21,150:poke n+22,150:poke n+12,150
20210 n=25618
20220 if peek(n)<>2 then 20410
20230 n=n+10
20240 if peek(n)=0 then poke n+100,170:goto 20310
20250 if peek(n)=2 then 20230
20260 n=n+10
20270 if peek(n)=1 then 20260
20280 poke n+100,172
20310 n=25618
20330 n=n-1
20340 if peek(n)=0 then poke n+100,170:goto 20390
20350 if peek(n)=2 then 20330
20360 n=n-1
20370 if peek(n)=1 then 20360
20380 poke n+100,172
20390 n=25718:poke n+9,160:poke n+19,150:poke n+18,150:poke n+8,150
20410 n=25681
20420 if peek(n)<>2 then 20610
20430 n=n-10
20440 if peek(n)=0 then poke n+100,170:goto 20510
20450 if peek(n)=2 then 20430
20460 n=n-10
20470 if peek(n)=1 then 20460
20480 poke n+100,172
20510 n=25681
20530 n=n+1
20540 if peek(n)=0 then poke n+100,170:goto 20590
20550 if peek(n)=2 then 20530
20560 n=n+1
20570 if peek(n)=1 then 20560
20580 poke n+100,172
20590 n=25781:poke n-9,160:poke n-19,150:poke n-18,150:poke n-8,150
20610 n=25688
20620 if peek(n)<>2 then 21000
20630 n=n-10
20640 if peek(n)=0 then poke n+100,170:goto 20710
20650 if peek(n)=2 then 20630
20660 n=n-10
20670 if peek(n)=1 then 20660
20680 poke n+100,172
20710 n=25688
20720 if peek(n)<>2 then 20100
20730 n=n-1
20740 if peek(n)=0 then poke n+100,170:goto 20790
20750 if peek(n)=2 then 20730
20760 n=n-1
20770 if peek(n)=1 then 20760
20780 poke n+100,172
20790 n=25788:poke n-11,160:poke n-21,150:poke n-22,150:poke n-12,150
21000 rem ende eckenbewertung
40000 rem computerzuege ******************************************************
40010 zc=ti
40020 poke 16,10*rnd(1)
40030 sys 24090
40040 if peek(25812)=0 then print g$:sc(sc)=25600:sc=sc+1:goto 48000
45000 rem ausgabe und ausfuehrung des zuges **********************************
45010 print f$;peek(25813);"[157] "
45015 g=peek(25813)+25600
45020 d=0
45030 for n=1 to 8
45040 read e:f=g+e
45050 if peek(f)<>1 then next n:goto 45150
45060 f=f+e
45070 if peek(f)=1 then 45060
45080 if peek(f)<>2 then next n:goto 45150
45090 f=g+e
45100 h=(f-25600)/10
45110 poke(1025.5+int(h)*80+(h-int(h))*20),81
45120 poke f,2:f=f+e:d=d+1
45130 if peek(f)=1 then 45100
45140 next n
45150 restore
45160 poke g,2:h=(g-25600)/10
45170 poke(1025.5+int(h)*80+(h-int(h))*20),81
45180 if fl=1 then return
45190 sc(sc)=g:sc=sc+1
46000 rem zugfeld veraendern *************************************************
46005 g=g+512
46010 poke g,0
46020 for n=1 to 8
46030 read m
46040 poke(g+m),(peek(g+m)+1)
46050 next n:restore
47000 rem berechnung der felderzahl ******************************************
47010 as=as-d:ac=ac+d+1
47020 print left$(h$,9);tab(32);ac;"[157] "
47030 print "";tab(32);as;"[157] "
47040 if fl=1 then return
48000 rem zeitrechnung *******************************************************
48010 zc(za)=(ti-zc)/60:tc=tc+zc(za):za=za+1
48020 print left$(h$,15);tab(32);int(tc*10)/10
49000 if as+ac<64 then 15000
50000 rem spielende **********************************************************
50010 print left$(h$,20);"das spiel ist beendet "
50020 if ac>32 then print "ich habe gewonnen "
50030 if ac=32 then print "das spiel endete remis "
50040 if ac<32 then print "sie haben glueck gehabt "
50042 print " "
50045 print "space[146] druecken"
50050 get z$:if z$="" then 50050
51000 rem zeitdiagramm *******************************************************
51002 za=0
51005 print "[147]"
51007 for n=2 to 0 step -.2:print int(n*10+.5)/10;"[192]":next
51008 print " 1 5 10 14 21 25 30"
51010 if zc(za)=0 then 51110
51020 zc=int(zc(za)*10+.5)
51040 ze=1950+za
51045 if zc>20 then zc=20
51050 for n=1 to zc
51060 poke(ze-40*n),160:poke(ze-40*n+54272),7
51070 next n
51090 za=za+1
51100 goto 51010
51110 get z$:if z$<>" " then 51110
52000 rem spiel wiederholen **************************************************
52010 fl=1
52015 for n=1to16:read m:next:for n=25600 to 25699:read m:poke n,m:next:restore
52020 gosub 13000
52025 print left$(h$,20);"s p a c e[146] druecken"
52030 ss=0:sc=0:ac=2:as=2
52035 if m$="n" then 52060
52040 a=ss(ss):ss=ss+1
52050 if a<>25600 then gosub 16030:gosub 17000:z=z+1
52051 if z=60 then 61000
52052 get z$:if z$<>" " then 52052
52060 g=sc(sc):sc=sc+1
52070 if g<>25600 then gosub 45020:gosub 47000:z=z+1
52080 if z=60 then 52110
52090 get z$:if z$=" " then 52040
52100 goto 52090
52110 print left$(h$,20);" moechten sie noch einmal spielen ?"
52120 get a$:if a$="j" then clr:fl=1:goto 11510
52130 if a$<>"n" then 52120
52140 end
53000 rem zeitrechnung spieler ***********************************************
53010 print "";tab(32);int((ts+(ti-zs)/60)*10)/10
53020 return
59998 data 11,10,9,1,-1,-9,-10,-11
59999 data 1,9,10,11,255,247,246,245
60000 data 9,9,9,9,9,9,9,9,9,9
60010 data 9,0,0,0,0,0,0,0,0,9
60020 data 9,0,0,0,0,0,0,0,0,9
60030 data 9,0,0,0,0,0,0,0,0,9
60040 data 9,0,0,0,2,1,0,0,0,9
60050 data 9,0,0,0,2,1,0,0,0,9
60060 data 9,0,0,0,0,0,0,0,0,9
60070 data 9,0,0,0,0,0,0,0,0,9
60080 data 9,0,0,0,0,0,0,0,0,9
60090 data 9,9,9,9,9,9,9,9,9,9
60100 data 00,00,00,00,00,00,00,00,00,00
60110 data 00,80,40,60,55,55,60,40,80,00
60120 data 00,40,00,35,35,35,35,00,40,00
60130 data 00,60,35,41,40,40,41,35,60,00
60140 data 00,60,35,40,00,00,40,35,60,00
60150 data 00,60,35,40,00,00,40,35,60,00
60160 data 00,60,35,41,40,40,41,35,60,00
60170 data 00,40,00,35,35,35,35,00,40,00
60180 data 00,80,40,60,55,55,60,40,80,00
60190 data 00,00,00,00,00,00,00,00,00,00
60200 data 000,000,000,000,000,000,000,000,000,000
60210 data 000,127,127,127,127,127,127,127,127,000
60220 data 000,127,127,127,127,127,127,127,127,000
60230 data 000,127,127,128,128,128,128,127,127,000
60240 data 000,127,127,128,000,000,128,127,127,000
60250 data 000,127,127,128,000,000,128,127,127,000
60260 data 000,127,127,128,128,128,128,127,127,000
60270 data 000,127,127,127,127,127,127,127,127,000
60280 data 000,127,127,127,127,127,127,127,127,000
60290 data 000,000,000,000,000,000,000,000,000,000
61000 end
61700 data 169,0,141,212,100,141,213,100,169,11,141,214,100
61800 data 174,214,100,189,0,102,16,67
61900 data 169,0,141,208,100,160,200,173,214,100,24,121,0,100,170,189,0,100
61910 data 201,1,208,35,238,216,100,138,24,121,0,100,170
61920 data 189,0,100,201,1,240,240,201,2,208,10,173,208,100,24
61930 data 109,216,100,141,208,100,169,0,141,216,100,200,192,208,208,201
61950 data 173,208,100,208,3,76,124,95,174,214,100,189,100,100,24
61960 data 109,208,100,141,208,100,56,205,212,100,144,234
62000 data 162,11,189,0,100,157,0,101,232,224,89,208,245
62100 data 174,214,100,169,2,157,0,101,160,200,185,0,100,24
62110 data 109,214,100,170,189,0,101,201,1,208,40,138
62120 data 24,121,0,100,170,189,0,101,201,1,240,243
62130 data 201,2,208,23,173,214,100,24,121,0,100,170
62140 data 189,0,101,201,1,208,8,169,2,157,0,101,138
62150 data 208,236,200,192,208,208,196
62160 data 169,0,141,211,100,169,11,141,215,100
62180 data 173,215,100,170,189,0,101,208,99
62200 data 169,0,141,209,100,160,200,173,215,100,24,121,0,100,170,189,0,101
62210 data 201,2,208,35,238,216,100,138,24,121,0,100,170
62220 data 189,0,101,201,2,240,240,201,1,208,10,173,209,100,24
62230 data 109,216,100,141,209,100,169,0,141,216,100,200,192,208,208,201
62250 data 173,209,100,240,32
62300 data 174,215,100,189,100,101,24,109,209,100,56,205,211,100
62310 data 144,3,141,211,100
62350 data 56,173,208,100,237,211,100,56,237,212,100,144,43
62360 data 238,215,100,173,215,100,201,89,208,138
62400 data 56,173,208,100,237,211,100,56,205,212,100
62401 data 208,9,165,16,56,201,5,144,7,176,11,144,9
62410 data 141,212,100,173,214,100,141,213,100
62500 data 238,214,100,173,214,100,201,89,240,3,76,39,94,96